import { Component, OnInit, ViewChild, ViewContainerRef, Renderer2, TemplateRef } from '@angular/core';
import { HttpHelper } from '../../../Helper/HttpHelper';
import { SmartTableDataSource } from '../../../Helper/SmartTableDataSource';
import { Fun } from '../../../Config/Fun';
import { DtoResultObj } from '../../../Model/DtoRec/DtoResult';
import { NbDialogService, NbWindowService } from '@nebular/theme';
import { ServerSourceConf } from '../../../Lib/ng2-smart-table/lib/lib/data-source/server/server-source.conf';
import { Variables } from '../../../Config/Variables';

@Component({
  selector: 'wzl-course-lookTeacherr',
  templateUrl: './course-lookTeacher.html',
})
export class LookTeacherComponent implements OnInit {
  bean: any;
  classes_id = 0;

  constructor(
    public httpHelper: HttpHelper,
    private dialogService: NbDialogService
  ) {

  }

  ngOnInit() {

  }

  myModelChange(val) {
    if (this.classes_id != val) {
      this.classes_id = val;
      console.log(this.classes_id);
      this.httpHelper.Post("WeekCourse/GetTeacherCourse", { Key: this.classes_id }).then((result: DtoResultObj<string>) => {
        Fun.HideLoading();
        if (result.success) {
          this.bean = result.data;

          console.log(this.bean)
        }
        else {
          Fun.Hint(result.msg);
        }
        console.log(result);
      })
    }
  }

  openObj;
  clickCourse(id, dialog: TemplateRef<any>) {
    // this.openObj= this.dialogService.open(
    //   dialog,
    //   {
    //     context: this.bean.courseDic[id],
    //     hasBackdrop: false,
    //   });
  }


}
